package cn.maihe.elg.operation.repository.entity;

import cn.maihe.framework.starter.mybatis.mapper.Fn;
import cn.maihe.framework.starter.mybatis.mapper.PlusEntityWrapper;

public final class UserRoleDOCondition {
    private PlusEntityWrapper<UserRoleDO> ew;

    public UserRoleDOCondition() {
        this.ew = new PlusEntityWrapper(UserRoleDO.class);
    }

    public static UserRoleDOCondition builder() {
        return new UserRoleDOCondition();
    }

    public PlusEntityWrapper<UserRoleDO> build() {
        return this.ew;
    }

    public UserRoleDOCondition or() {
        this.ew.orNew();
        return this;
    }

    public UserRoleDOCondition and() {
        this.ew.andNew();
        return this;
    }

    private boolean isAndOr() {
        return ew.originalSql() == null || "".equals(ew.originalSql()) ? true : ew.originalSql().endsWith("AND ()") || ew.originalSql().endsWith("OR ()");
    }

    public void clear() {
        this.ew = null;
        this.ew = new PlusEntityWrapper(UserRoleDO.class);
    }

    public UserRoleDOCondition setSqlSelect(String sqlStr) {
        ew.setSqlSelect(sqlStr);
        return this;
    }

    public UserRoleDOCondition orderAsc(String column) {
        ew.orderBy(true, column, true);
        return this;
    }

    public UserRoleDOCondition orderDesc(String column) {
        ew.orderBy(true, column, false);
        return this;
    }

    public UserRoleDOCondition groupBy(String column) {
        ew.groupBy(column);
        return this;
    }

    public <E, R> UserRoleDOCondition orderAsc(Fn<E, R> fn) {
        ew.orderAsc(fn);
        return this;
    }

    public <E, R> UserRoleDOCondition orderDesc(Fn<E, R> fn) {
        ew.orderDesc(fn);
        return this;
    }

    public <E, R> UserRoleDOCondition groupBy(Fn<E, R> fn) {
        ew.groupBy(fn);
        return this;
    }

    public UserRoleDOCondition exists(String sqlStr) {
        ew.exists(sqlStr);
        return this;
    }

    public UserRoleDOCondition notExists(String sqlStr) {
        ew.notExists(sqlStr);
        return this;
    }

    public UserRoleDOCondition having(String sqlStr, Object... params) {
        ew.having(sqlStr, params);
        return this;
    }

    public UserRoleDOCondition andUserIdIsNull() {
        ew.isNull("user_id");
        return this;
    }

    public UserRoleDOCondition orUserIdIsNull() {
        if(!isAndOr()){
            ew.or();
        }
        ew.isNull("user_id");
        return this;
    }

    public UserRoleDOCondition andUserIdIsNotNull() {
        ew.isNotNull("user_id");
        return this;
    }

    public UserRoleDOCondition orUserIdIsNotNull() {
        if(!isAndOr()){
            ew.or();
        }
        ew.isNotNull("user_id");
        return this;
    }

    public UserRoleDOCondition andUserIdEq(Object value) {
        ew.eq("user_id", value);
        return this;
    }

    public UserRoleDOCondition orUserIdEq(Object value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.eq("user_id", value);
        return this;
    }

    public UserRoleDOCondition andUserIdNe(Object value) {
        ew.ne("user_id", value);
        return this;
    }

    public UserRoleDOCondition orUserIdNe(Object value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.ne("user_id", value);
        return this;
    }

    public UserRoleDOCondition andUserIdGt(Object value) {
        ew.gt("user_id", value);
        return this;
    }

    public UserRoleDOCondition orUserIdGt(Object value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.gt("user_id", value);
        return this;
    }

    public UserRoleDOCondition andUserIdGe(Object value) {
        ew.ge("user_id", value);
        return this;
    }

    public UserRoleDOCondition orUserIdGe(Object value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.ge("user_id", value);
        return this;
    }

    public UserRoleDOCondition andUserIdLt(Object value) {
        ew.lt("user_id", value);
        return this;
    }

    public UserRoleDOCondition orUserIdLt(Object value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.lt("user_id", value);
        return this;
    }

    public UserRoleDOCondition andUserIdLe(Object value) {
        ew.le("user_id", value);
        return this;
    }

    public UserRoleDOCondition orUserIdLe(Object value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.le("user_id", value);
        return this;
    }

    public UserRoleDOCondition andUserIdIn(Object... value) {
        ew.in("user_id", value);
        return this;
    }

    public UserRoleDOCondition orUserIdIn(Object... value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.in("user_id", value);
        return this;
    }

    public UserRoleDOCondition andUserIdNotIn(Object... value) {
        ew.notIn("user_id", value);
        return this;
    }

    public UserRoleDOCondition orUserIdNotIn(Object... value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.notIn("user_id", value);
        return this;
    }

    public UserRoleDOCondition andUserIdBetween(Object value, Object value1) {
        ew.between("user_id", value, value1);
        return this;
    }

    public UserRoleDOCondition orUserIdBetween(Object value, Object value1) {
        if(!isAndOr()){
            ew.or();
        }
        ew.between("user_id", value, value1);
        return this;
    }

    public UserRoleDOCondition andUserIdNotBetween(Object value, Object value1) {
        ew.notBetween("user_id", value, value1);
        return this;
    }

    public UserRoleDOCondition orUserIdNotBetween(Object value, Object value1) {
        if(!isAndOr()){
            ew.or();
        }
        ew.notBetween("user_id", value, value1);
        return this;
    }

    public UserRoleDOCondition andUserIdLike(String value) {
        ew.like("user_id", value);
        return this;
    }

    public UserRoleDOCondition orUserIdLike(String value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.like("user_id", value);
        return this;
    }

    public UserRoleDOCondition andUserIdNotLike(String value) {
        ew.notLike("user_id", value);
        return this;
    }

    public UserRoleDOCondition orUserIdNotLike(String value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.notLike("user_id", value);
        return this;
    }

    public UserRoleDOCondition andRoleIdIsNull() {
        ew.isNull("role_id");
        return this;
    }

    public UserRoleDOCondition orRoleIdIsNull() {
        if(!isAndOr()){
            ew.or();
        }
        ew.isNull("role_id");
        return this;
    }

    public UserRoleDOCondition andRoleIdIsNotNull() {
        ew.isNotNull("role_id");
        return this;
    }

    public UserRoleDOCondition orRoleIdIsNotNull() {
        if(!isAndOr()){
            ew.or();
        }
        ew.isNotNull("role_id");
        return this;
    }

    public UserRoleDOCondition andRoleIdEq(Object value) {
        ew.eq("role_id", value);
        return this;
    }

    public UserRoleDOCondition orRoleIdEq(Object value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.eq("role_id", value);
        return this;
    }

    public UserRoleDOCondition andRoleIdNe(Object value) {
        ew.ne("role_id", value);
        return this;
    }

    public UserRoleDOCondition orRoleIdNe(Object value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.ne("role_id", value);
        return this;
    }

    public UserRoleDOCondition andRoleIdGt(Object value) {
        ew.gt("role_id", value);
        return this;
    }

    public UserRoleDOCondition orRoleIdGt(Object value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.gt("role_id", value);
        return this;
    }

    public UserRoleDOCondition andRoleIdGe(Object value) {
        ew.ge("role_id", value);
        return this;
    }

    public UserRoleDOCondition orRoleIdGe(Object value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.ge("role_id", value);
        return this;
    }

    public UserRoleDOCondition andRoleIdLt(Object value) {
        ew.lt("role_id", value);
        return this;
    }

    public UserRoleDOCondition orRoleIdLt(Object value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.lt("role_id", value);
        return this;
    }

    public UserRoleDOCondition andRoleIdLe(Object value) {
        ew.le("role_id", value);
        return this;
    }

    public UserRoleDOCondition orRoleIdLe(Object value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.le("role_id", value);
        return this;
    }

    public UserRoleDOCondition andRoleIdIn(Object... value) {
        ew.in("role_id", value);
        return this;
    }

    public UserRoleDOCondition orRoleIdIn(Object... value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.in("role_id", value);
        return this;
    }

    public UserRoleDOCondition andRoleIdNotIn(Object... value) {
        ew.notIn("role_id", value);
        return this;
    }

    public UserRoleDOCondition orRoleIdNotIn(Object... value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.notIn("role_id", value);
        return this;
    }

    public UserRoleDOCondition andRoleIdBetween(Object value, Object value1) {
        ew.between("role_id", value, value1);
        return this;
    }

    public UserRoleDOCondition orRoleIdBetween(Object value, Object value1) {
        if(!isAndOr()){
            ew.or();
        }
        ew.between("role_id", value, value1);
        return this;
    }

    public UserRoleDOCondition andRoleIdNotBetween(Object value, Object value1) {
        ew.notBetween("role_id", value, value1);
        return this;
    }

    public UserRoleDOCondition orRoleIdNotBetween(Object value, Object value1) {
        if(!isAndOr()){
            ew.or();
        }
        ew.notBetween("role_id", value, value1);
        return this;
    }

    public UserRoleDOCondition andRoleIdLike(String value) {
        ew.like("role_id", value);
        return this;
    }

    public UserRoleDOCondition orRoleIdLike(String value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.like("role_id", value);
        return this;
    }

    public UserRoleDOCondition andRoleIdNotLike(String value) {
        ew.notLike("role_id", value);
        return this;
    }

    public UserRoleDOCondition orRoleIdNotLike(String value) {
        if(!isAndOr()){
            ew.or();
        }
        ew.notLike("role_id", value);
        return this;
    }
}
